<?php
namespace Home\Controller;
use Think\Controller;


class BaseController extends Controller {
                 
   
   
            
   public function __construct(){
       
       parent::__construct();

       

       $Ar_cat =M('Article_cat');
       $map['status']=1;
       $list = $Ar_cat->field('name,cid,pid,temp')->where($map)->select();
       $map1['pid']=0;
       $order='cid';
       $list_p = $Ar_cat->field('name,cid,pid,temp')->where($map1)->order($order)->select();
       foreach ($list as $key=>$value)  {
           $pid=$value['pid'];
           if ($pid>0){
               $list_p[$pid-1]['child']=$Ar_cat->where('pid='.$pid)->select();
           }
       }
       $this->assign('nav_cat',$list_p);

  
      
       $Cof =M('Config');
       $id=1;
       $config =$Cof->find($id);
        $this->assign('config',$config);
        
        
        $About =M('About');
        $map['status']=1;
        $about =$About->where($map)->select();
        
        $this->assign('about',$about);
        
        
   }          
            
            
}